package test

import (
	"gitee.com/cdsailyj/go-vpn/common/util"
	"github.com/shopspring/decimal"
)

type Book struct {
	Id          int             `gorm:"column:id;primaryKey;autoIncrement" json:"id" form:"id"`
	Title       string          `gorm:"column:title;default:''" json:"title" form:"title"`
	Author      string          `gorm:"column:author;default:''" json:"author" form:"author"`
	CreatedTime *util.LocalTime `gorm:"column:created_time;type:datetime;not null;autoCreateTime" json:"created_time" form:"created_time" time_format:"2006-01-02 15:04:05"`
	Price       decimal.Decimal `gorm:"column:price;default:0;comment:'价格'" json:"price" form:"price"`
	PageTotal   int             `gorm:"column:page_total;default:0" json:"page_total" form:"page_total"`
}

func (Book) TableName() string {
	return "book"
}
